package com.qingyouchuxing.mall.biz.mapper;

import com.mybatisflex.core.BaseMapper;
import com.mybatisflex.core.query.QueryWrapper;
import com.qingyouchuxing.mall.biz.domain.entity.MallGoodsSpu;
import org.apache.ibatis.annotations.Mapper;

import static com.qingyouchuxing.mall.biz.domain.entity.table.MallGoodsSpuTableDef.MALL_GOODS_SPU;

import java.util.List;


@Mapper
public interface MallGoodsSpuMapper extends BaseMapper<MallGoodsSpu> {

    /**
     * 根据商品id查询spu
     * @param fkGoodsId 商品id
     */
    default List<MallGoodsSpu> selectListByFkGoodsId(Long fkGoodsId){
        QueryWrapper queryWrapper = QueryWrapper.create().where(MALL_GOODS_SPU.FK_GOODS_ID.eq(fkGoodsId));
        return selectListByQuery(queryWrapper);
    }
}
